<?php
// +---------------------------------------------------------------------------+
// | This file is part of the KnowledgebasePublisher package                   |
// | KnowledgebasePublisher - web based knowledgebase publisher tool           |
// |                                                                           |
// | Author:  Evgeny Leontev <eleontev@gmail.com>                              |
// | Copyright (c) 2005 Evgeny Leontev                                         |
// |                                                                           |
// | For the full copyright and license information, please view the LICENSE   |
// | file that was distributed with this source code.                          |
// +---------------------------------------------------------------------------+

class KBClientAction_entry extends KBClientAction_common
{

	function &execute($controller, $manager) {

		if(isset($this->rp->do_rate)) {
			
			if($manager->isUserVoted($this->entry_id) === false && $this->rp->rate) {
				$manager->addVote($this->entry_id, $this->rp->rate);
				$manager->setUserVoted($this->entry_id);
			}
			
			$controller->go('entry', $this->category_id, $this->entry_id);
		}
		
		if($manager->isUserViewed($this->entry_id) === false) {
			$manager->addView($this->entry_id);
			$manager->setUserViewed($this->entry_id);
		}
		
		$view = &$controller->getView();
		return $view;
	}
}
?>